#-*- coding:utf-8 -*-

TYPE1 = {}
TYPE1[100] = {"name":"二手交易", "ordernum":1}
TYPE1[101] = {"name":"教育培训", "ordernum":2}
TYPE1[102] = {"name":"美容保健", "ordernum":3}
TYPE1[103] = {"name":"家政服务", "ordernum":4}


TYPE2 = {}
TYPE2[10001] = {
    "name":"手机", 
    "freepost":2, 
    "status":1, 
    "fields": [
        {"tag":"价格", "name":"price", "type":"uint"} ,   
        {"tag":"公司", "name":"company", "type":"string", "maxlen":60} ,   
        {"tag":"成色", "name":"chengshe", "type":"choice", "choices":[
            {"tag":"全新", "value":"1"}, 
            {"tag":"二手", "value":"2"}, 
            ]} ,   

        {"tag":"品牌", "name":"band", "type":"select", "selects":[
            {"tag":"iphone", "value":1},
            {"tag":"三星", "value":2},
            {"tag":"华为", "value":3},
            ]} ,   
    ]
}

TYPE2[10002] = {
    "name":"家具", 
    "freepost":2, 
    "status":1
}


for k, v in TYPE1.items(): v["id"] = k
for k, v in TYPE2.items(): v["id"] = k


def getsubtypes(typeid):
    return [ v for v in TYPE2.values() if v["id"]/100 == typeid ]
